/*
 * @Descripttion: GGB
 * @version: 1.0
 * @Author: GGB
 * @Date: 2021-08-06 07:10:08
 * @LastEditors: GGB
 * @LastEditTime: 2021-08-24 12:08:59
 */
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

class StartRoom extends StatelessWidget {
  const StartRoom({Key key, this.onTap, this.showIcon}) : super(key: key);
  final VoidCallback onTap;
  final bool showIcon;

  @override
  Widget build(BuildContext context) => Positioned(
        bottom: 8,
        left: 64,
        right: 24,
        child: Row(
          children: [
            Spacer(),
            Container(
              height: 36,
              width: 154,
              decoration: ShapeDecoration(
                color: Colors.green,
                shape: StadiumBorder(),
              ),
              child: Row(
                crossAxisAlignment: CrossAxisAlignment.center,
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Icon(
                    Icons.add,
                    size: 16,
                    color: Colors.white,
                  ),
                  Padding(
                    padding: const EdgeInsets.all(8.0),
                    child: Text("Start a room",
                        style: GoogleFonts.montserrat(
                          fontSize: 16,
                          color: Colors.white,
                          fontWeight: FontWeight.bold,
                        )),
                  ),
                ],
              ),
            ),
            Spacer(),
            !showIcon
                ? IconButton(
                    icon: Icon(Icons.apps),
                    iconSize: 34,
                    onPressed: onTap,
                  )
                : SizedBox(height: 50, width: 50),
          ],
        ),
      );
}
